jsx3.Class.defineClass(
        "tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.tabContent.environmentOverview.EnvironmentOverview", //the full name of the class to create
        jsx3.lang.Object, //  extends
        [tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.EnvironmentTabInterface], // implements
        function (plugin) {
        
            plugin.instance = null

            plugin.getInstance = function(args) {
                if(!this.instance) {
                    this.instance = new tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.tabContent.environmentOverview.EnvironmentOverview();
                }
                return this.instance;
            }

            plugin.prototype.getNamespace = function() {
               return "tibco.admin";
            }
            
            plugin.prototype.getTabText = function() {
				return tibco.admin.Main.getServer().getDynamicProperty("@MM@general@OverviewTitle");
            	//return "Overview";
            }

            plugin.prototype.loadComponent = function(parent, environmentId) {
                var overviewBlock = tibco.admin.Main.loadUIResource(parent, this.getNamespace(), "tibco/admin/monitormanage/uicomponents/page/gridInfrastructure/tabContent/environmentOverview/components/environmentOverview.xml", true);

				var machinesContentPane = overviewBlock.getDescendantOfName("machinesContentPane");
                if(!tibco.admin.monitormanage || !tibco.admin.monitormanage.uicomponents || !tibco.admin.monitormanage.uicomponents.table || !tibco.admin.monitormanage.uicomponents.table.machines || !tibco.admin.monitormanage.uicomponents.table.machines.Machines)
                { tibco.admin.Main.loadClass("tibco/admin/monitormanage/uicomponents/table/machines/Machines.js", this.getNamespace()); }
                var machineTable = tibco.admin.Main.loadUIResource(machinesContentPane, this.getNamespace(), "tibco/admin/monitormanage/uicomponents/table/machines/components/machines.xml", true);
                machineTable.setUpComponent("_MM_infra", true, false, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId, false);
                tibco.admin.monitormanage.general.PollingHandler.register(tibco.admin.monitormanage.general.PollingHandler.GENERAL_POLLING_HANDLER_ID, machineTable, machineTable.updateComponent, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId);
                tibco.admin.monitormanage.general.RefreshHandler.register(machineTable, machineTable.updateComponent, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId);

                var nodesContentPane = overviewBlock.getDescendantOfName("nodesContentPane");
				if(!tibco.admin.monitormanage || !tibco.admin.monitormanage.uicomponents || !tibco.admin.monitormanage.uicomponents.table || !tibco.admin.monitormanage.uicomponents.table.nodes || !tibco.admin.monitormanage.uicomponents.table.nodes.Nodes)
                { tibco.admin.Main.loadClass("tibco/admin/monitormanage/uicomponents/table/nodes/Nodes.js", this.getNamespace()); }
                var nodesTable = tibco.admin.Main.loadUIResource(nodesContentPane, this.getNamespace(), "tibco/admin/monitormanage/uicomponents/table/nodes/components/nodes.xml", true);
                nodesTable.setUpComponent("_MM_infra", true, false, null, null, true, false, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId, false, true);
                tibco.admin.monitormanage.general.PollingHandler.register(tibco.admin.monitormanage.general.PollingHandler.GENERAL_POLLING_HANDLER_ID, nodesTable, nodesTable.updateComponent, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId);
                tibco.admin.monitormanage.general.RefreshHandler.register(nodesTable, nodesTable.updateComponent, tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId);
            }
            
            plugin.prototype.updateComponent = function(environmentId) {
            	// this method does not have to do anything considering the component update is
            	// handled by the components within this component
            	jsx3.log("Environment overview tab updateComponent invoked with environmentId = " + environmentId); 
            }
            
            plugin.prototype.tabClicked = function(objEvent) {
            	tibco.admin.monitormanage.uicomponents.dropdown.timeframe.Timeframe.showTimeframe(tibco.admin.monitormanage.uicomponents.page.gridInfrastructure.GridInfrastructure.environmentScreenId);
        	}

        });